package com.tianqingwl.gsystem.test.controller;

import com.tianqingwl.gsystem.sysuser.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class HelloController {

    @Autowired
    private SysUserService sysUserService;
    @Autowired
    private PasswordEncoder passwordEncoder;

    @GetMapping("/init")
    @ResponseBody
    public Object init(){
        boolean b = sysUserService.updateSysUserPassword("admin","123456");

        return b;
    }

    @GetMapping("/test.html")
    public String testPage(){
        return "manage/test";
    }
}
